//
//  ByeCodeTableViewCell.m
//  PlayerWorld
//
//  Created by 汪的一声就哭了！ on 16/6/21.
//  Copyright © 2016年 刘成. All rights reserved.
//
#define WIDTH self.contentView.bounds.size.width
#define HEIGHT self.contentView.bounds.size.height
#import "ByeCodeTableViewCell.h"

@implementation ByeCodeTableViewCell
{
    
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        self.label = [[UILabel alloc] init];
        [self.contentView addSubview:self.label];
        self.label.backgroundColor = [UIColor colorWithRed:236.0/255.0 green:237.0/255.0 blue:238.0/255.0 alpha:1];
        self.label.textAlignment = NSTextAlignmentCenter;
        self.label.textColor = [UIColor colorWithRed:110.0/255.0 green:111.0/255.0 blue:112.0/255.0 alpha:1];
        self.label.font = [UIFont systemFontOfSize:12];
        
        _flow = [[UICollectionViewFlowLayout alloc] init];
        self.collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(70, 0, WIDTH-90, HEIGHT) collectionViewLayout:_flow];
        self.collectionView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:self.collectionView];
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    self.label.frame = CGRectMake(10, 15, 50, 20);
    self.label.layer.cornerRadius = 10;
    self.label.clipsToBounds = YES;
    
    _flow.minimumLineSpacing = 10;
    _flow.minimumInteritemSpacing = 10;
    _collectionView.frame = CGRectMake(70, 10, WIDTH-90, HEIGHT-20);
    _collectionView.scrollEnabled = NO;
}
@end
